class A{
    name!:string;
    age:number;

    constructor(name:string, age:number) {
        this.name = name;
        this.age = age;
    }
    running(){
        console.log(this.name + " running")
    }
    eating(){
        console.log(this.name + " eating")
    }
}

let p: A = new A("ES6+",7);
p.running()
p.eating()
/*p={
    name: "ES6+",
    age: 7
}*/
let p2: A = {
    name:"p2",
    age: 18,
    running(){},
    eating(){}
}

console.log();

export {}